package drds.global_transaction;


import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

public class BranchTransactionInfo implements Serializable
{
    @Setter
    @Getter
    private String globalTransactionId;
    @Setter
    @Getter
    private String branchTransactionId;
    //
    @Setter
    @Getter
    private long globalTransactionCreateDateTimeLong;
    @Setter
    @Getter
    private int branchTransactionTimeout;

    @Setter
    @Getter
    private transient volatile boolean runnable = true;

    public boolean isTimeOut()
    {
        long currentTimeMillis = System.currentTimeMillis();
        if (currentTimeMillis > this.globalTransactionCreateDateTimeLong + this.branchTransactionTimeout)
        {
            return true;
        } else
        {
            return false;
        }
    }
    //存在一个问题,就是系统强制停止一个全局事务
}
